package com.lagou;

import com.lagou.domain.Resume;
import com.lagou.repository.ResumeRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.List;

/**
 * @author mcl
 * @date 2021/9/17 12:31
 * @description
 */
@SpringBootApplication
public class MongoRepositoryMain {

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(MongoRepositoryMain.class,args);

        ResumeRepository repository = applicationContext.getBean(ResumeRepository.class);

        System.out.println(repository.count());
        List<Resume> all = repository.findAll();
        System.out.println(all);

        repository.insert(new Resume("zhangsan", "31000"));
        System.out.println(repository.count());

    }
}
